<template>
  <div>
    <!-- <div v-if="isreien === '1'" style="text-align:center;font-size:45px;margin-top:400px">瑞恩智慧园区综合管理平台</div>
    <div v-else style="text-align:center;font-size:45px;margin-top:400px"><span>凯金智慧园区综合管理平台</span></div> -->
    <!-- <index v-if="userData.showPage === 1" /> -->
    <component v-if="indexRouter && userData.showPage === 1"
               :is="indexRouter"></component>
    <!-- 0不显示主页，显示工作台 -->
    <workSpace vheight="91vh"
               v-if="userData.showPage === 0" />
  </div>
</template>

<script>
import index from './comprehensive-situation/index.vue'
import workSpace from './workSpace/index.vue'
export default {
  components: {
    index,
    workSpace
  },
  data: function () {
    return {
      isreien: '0',
      userData: {
      },
      router: ''
    }
  },
  computed: {
    indexRouter () {
      // 这里通过路由参数判断引入文件
      let router = this.$store.state.user.router
      if (router) {
        return () => import('./' + router + '.vue')
      } else {
        return null
      }
    }
  },
  // created () {
  //   this.$http.get('system/sysGlobalConfig/getSysGlobalConfig?type=3').then(({ data: res }) => {
  //     if (res.code !== 0) {
  //       return this.$message.error(res.msg)
  //     }
  //     this.router = res.data.value
  //   })
  // },
  mounted () {
    // setTimeout(() => {
    this.userData = this.$store.state.user
    if (this.userData.id === '715161385118408704') {
      this.$set(this.userData, 'showPage', 1)
    }
    // }, 1000)
    this.isreien = localStorage['isRuiEn']
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
</style>
